import java.io.File


fun findAllFile(rootFile: File,filePaths: MutableList<String> ,isAdd: (File) -> Boolean = { true } ) {
    if (rootFile.isFile){
        if (isAdd(rootFile)){
            filePaths.add(rootFile.absolutePath)
        }
        return
    }
    rootFile.listFiles()?.forEach {
       if (it.isFile){
           if (isAdd(it)){
               filePaths.add(it.absolutePath)
           }
       }else{
           findAllFile(it,filePaths, isAdd)
       }
    }
}

/**
 *
 * 获取不能作为包名路径的无效文件夹
 */
fun checkInvalidPackageDir(rootFile: File,filePaths: MutableList<String>){
    if (rootFile.isFile){
        return
    }
    if (rootFile.name.contains(".")){
        filePaths.add(rootFile.absolutePath)
    }
    rootFile.listFiles()?.forEach {
        if (it.isDirectory){
            checkInvalidPackageDir(it,filePaths)
        }
    }

}